<php>
	$t = 0;
	$ft = 0;
	$reg = 0;
</php>

<volist name="defineformlist" id="vo">

	<div class="layui-form-item">

		<label class="layui-form-label">

		   {$vo.form_description}

		</label>

		<eq name="vo.form_type" value="region">

			<php>
				$reg++;
			</php>

			<div class="region-input-div fl wd60">

			<div class="layui-input-inline wd100 mb10 layui-form region-item" lay-filter="country">

				<select class="regionCountry" name="highKeyword[define_form][{$vo.form_name}][defaultCountry]" lay-filter="select-country<php>echo $reg;</php>" id="country<php>echo $reg;</php>" lay-ignore >

					<option value="">{:L('PLEASE_SELECT')}</option>

					<volist name="country" id="vc">

						<option value="{$vc.code}">{$vc.name}</option>

					</volist>

				</select>

			</div>

			<div class="layui-input-inline wd100 mb10 hidden layui-form region-item" lay-filter="province">

				<select class="regionProv" name="highKeyword[define_form][{$vo.form_name}][defaultProv]" lay-filter="select-province<php>echo $reg;</php>" id="province<php>echo $reg;</php>" lay-ignore>

					<option value="">{:L('PLEASE_SELECT')}</option>

				</select>

			</div>

			<div class="layui-input-inline wd100 mb10 hidden layui-form region-item" lay-filter="city">

				<select class="regionCity" name="highKeyword[define_form][{$vo.form_name}][defaultCity]" lay-filter="select-city<php>echo $reg;</php>" id="city<php>echo $reg;</php>" lay-ignore>

					<option value="">{:L('PLEASE_SELECT')}</option>

				</select>

			</div>

			<div class="layui-input-inline wd100 mb10 hidden layui-form region-item" lay-filter="area">

				<select name="highKeyword[define_form][{$vo.form_name}][defaultArea]" lay-filter="select-area<php>echo $reg;</php>" id="area<php>echo $reg;</php>" lay-ignore >

					<option value="">{:L('PLEASE_SELECT')}</option>

				</select>

			</div>

			</div>

			<i class="layui-icon layui-icon-about intro-icon fl blue8 ml10" data-note="{:L('ENTER_NAME_SEARCH')}"></i>

			<script type="text/javascript">

				$("#country<php>echo $reg;</php>").select2();

				$("#province<php>echo $reg;</php>").select2();

				$("#city<php>echo $reg;</php>").select2();

				$("#area<php>echo $reg;</php>").select2();

				$("#country<php>echo $reg;</php>").change(function()
				{
					selectProvince('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");
				})

				$("#province<php>echo $reg;</php>").change(function()
				{
					selectCity('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");
				})

				$("#city<php>echo $reg;</php>").change(function()
				{
					selectArea('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");
				})

			</script>

		<else/>

			<div class="layui-input-inline">

				 <eq name="vo.form_type" value="text">

					<!-- 单行文本框 -->
					<input type="text" name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" placeholder="" class="layui-input">

				</eq>

				 <eq name="vo.form_type" value="phone">

					<!-- {:L('CELL_PHONE')} -->
					<input type="text" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" placeholder="" class="layui-input">

				</eq>

				 <eq name="vo.form_type" value="email">

					<!-- {:L('MAILBOX')} -->
					<input type="text" name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" placeholder="" class="layui-input">

				</eq>

				 <eq name="vo.form_type" value="number">

					<!-- {:L('DIGITAL')} -->
					<input type="number" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" placeholder="" class="layui-input">

				</eq>

				<eq name="vo.form_type" value="decimal">

					<!-- 小数 -->
					<input type="text" name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" placeholder="" class="layui-input">

				</eq>

				<eq name="vo.form_type" value="select">

					<!-- 下拉菜单 -->
					<select name="highKeyword[define_form][{$vo.form_name}]">

						<option value="">{$vo.form_description}</option>

						<foreach name="vo.option" item="op">

							<option value="{$op}" <eq name="highKeyword['define_form'][$vo['form_name']]" value="$op" >selected</eq>>{$op}</option>

						</foreach>

					</select>

				</eq>
				
				<eq name="vo.form_type" value="select_text">

					<php>
						$st++;
					</php>
					<!-- 下拉填写 -->
					<input type="text" name="highKeyword[define_form][{$vo.form_name}]" placeholder="" value="{$highKeyword['define_form'][$vo['form_name']]}" readonly="readonly" class="layui-input cursor">

					<ul id="selectText{$st}" class="select-text">

						<foreach name="vo.option" item="op">

							<li data-value="{$op}" <eq name="highKeyword['define_form'][$vo['form_name']]" value="$op" >class="active"</eq>>{$op}</li>

						</foreach>

					</ul>

					<script>

						$('input[name="highKeyword[define_form][{$vo.form_name}]').click(function ()
						{
							if($('#selectText{$st}').is(':hidden'))
							{
								$('#selectText{$st}').slideDown(100);
							}
							else
							{
								$('#selectText{$st}').slideUp(100);
							}

							$('#selectText{$st} li').click(function ()
							{
								$('#selectText{$st} li').removeClass('active');
								var value = $(this).data('value');
								if(value == '其他')
								{
									$('input[name="highKeyword[define_form][{$vo.form_name}]').removeAttr("readonly");
									$('input[name="highKeyword[define_form][{$vo.form_name}]').val('');
									$('input[name="highKeyword[define_form][{$vo.form_name}]').focus();
								}
								else
								{
									$('input[name="highKeyword[define_form][{$vo.form_name}]').attr('readonly','readonly');
									$('input[name="highKeyword[define_form][{$vo.form_name}]').val(value);
								}
								$(this).addClass('active');
								$('#selectText{$st}').hide();
							})
						})

					</script>

				</eq>

				<!-- 时间控件 -->
				<eq name="vo.form_type" value="date">

					<php>
						$ft++;
					</php>

					<input type='text' name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" class="layui-input cursor layui-form-time" id="form_time<php>echo $ft;</php>" placeholder="{:L('SELECT_TIME')}" >

				</eq>

				<eq name="vo.form_type" value="checkbox">

					<!-- 复选框 -->
					<volist name="vo.option" id="op">

						<input type="checkbox" name="highKeyword[define_form][{$vo.form_name}][]" <in name="op" value="$highKeyword['define_form'][$vo['form_name']]">checked</in> lay-skin="primary" title="{$op}" value="{$op}">

					</volist>

				</eq>

				<eq name="vo.form_type" value="radio">

					<!-- 单选框-->
					<volist name="vo.option" id="op">

						<input type="radio" name="highKeyword[define_form][{$vo.form_name}]" <eq name="highKeyword['define_form'][$vo['form_name']]" value="$op" >checked</eq> value="{$op}" title="{$op}">

					</volist>

				</eq>

				<!-- <input type="text" name="highKeyword[define_form][{$vo.form_name}]" value="{$highKeyword['define_form'][$vo['form_name']]}" placeholder="" class="layui-input">-->

			</div>

			<i class="layui-icon layui-icon-about intro-icon" data-note="{:L('ENTER_OR_SELECT_QUERY')}"></i>

		</eq>

	</div>

</volist>
